iT邦幫忙

DAY 14
0

用Packer, Vagrant和Salt秒殺你的環境建置系列 第 14

Day 14 - vagrant AWS plugin(編輯中)

  • 分享至 

  • xImage
  •  

Vagrant + aws 的應用也很夯

這是一個官方的 plugin

連結

Usage

Install using standard Vagrant 1.1+ plugin installation methods. After installing, vagrant up and specify the aws provider. An example is shown below.

$ vagrant plugin install vagrant-aws
...
$ vagrant up --provider=aws
...

Of course prior to doing this, you'll need to obtain an AWS-compatible box file for Vagrant.

Quick Start

After installing the plugin (instructions above), the quickest way to get started is to actually use a dummy AWS box and specify all the details manually within a config.vm.provider block. So first, add the dummy box using any name you want:

$ vagrant box add dummy https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box
...

And then make a Vagrantfile that looks like the following, filling in your information where necessary.

Vagrant.configure("2") do |config|
config.vm.box = "dummy"

config.vm.provider :aws do |aws, override|
aws.access_key_id = "YOUR KEY"
aws.secret_access_key = "YOUR SECRET KEY"
aws.keypair_name = "KEYPAIR NAME"

aws.ami = "ami-7747d01e"

override.ssh.username = "ubuntu"
override.ssh.private_key_path = "PATH TO YOUR PRIVATE KEY"
end
end

And then run vagrant up --provider=aws.


上一篇
Day 13 - vagrant vsphere plugin
下一篇
Day 14 - Packer
系列文
用Packer, Vagrant和Salt秒殺你的環境建置16
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言